package com.jerry.alibaba.transaction.service.impl;

import com.jerry.alibaba.transaction.dao.AccountDao;
import com.jerry.alibaba.transaction.entity.Account;
import com.jerry.alibaba.transaction.entity.Storage;
import com.jerry.alibaba.transaction.service.AccountService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.List;
import java.util.concurrent.TimeUnit;

@Service
public class AccountServiceImpl implements AccountService {

    @Resource
    private AccountDao accountDao;

    @Override
    public void decrease(Long userId, BigDecimal money) {
        accountDao.decrease(userId, money);
    }

    @Override
    public int create(Account account) {
        return accountDao.create(account);
    }

    @Override
    public Account getById(Long id) {
        return accountDao.getById(id);
    }

    @Override
    public List<Account> getList() {
        return accountDao.getList();
    }
}
